package com.core.reach.cloudhub.handler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.core.reach.cloudhub.domain.CommonResult;
import com.core.reach.cloudhub.domain.Payment;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author ga.zhang
 * @version V1.0
 * @description: TODO
 * @date 2020/3/31 14:41
 **/
public class CustomerBlockHandler {

    public static CommonResult<Payment> blockHandler(@PathVariable Long id, BlockException be) {
        Payment payment = new Payment(0L, null);
        return new CommonResult<>(445, "id:" + id + ";blockHandler-sentinel限流，无此流水，exception内容：" + be.getMessage(), payment);
    }

}
